//
//  LLNWHTTPConnection.h
//  LLFoundation
//
//  Created by my_liu on 2016/11/14.
//  Copyright © 2016年 . All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LLNWHTTPDetails.h"
#import "LLNWHTTPResponse.h"

#define LLNWHTTPLink   [LLNWHTTPConnection shareInstance]

/**
 *  http链接类
 */
@interface LLNWHTTPConnection : NSObject
/**
 *  单例
 *
 *  @return LLNWHTTPConnection实例
 */
+ (instancetype)shareInstance;

/**
 *  判断网络是否可用
 *
 *  @return 网络是否可用
 */
- (BOOL)checkNetworkConnection;

/**
 *  http请求cancel
 *
 *  @param requestKey request标示
 */
- (void)cancelRequestWithRequestKey:(NSString *)requestKey;

/**
 *  http建立请求 POST、GET、DELETE、PUT
 *
 *  @param manager 传nil即可
 *  @param requestInfo 请求所需的相关数据
 *  @param success 请求成功返回block
 *  @param failure 请求失败返回block
 */

- (void)requestSource:(id)manager withInfo:(LLNWHTTPDetails *)requestInfo success:(void(^)(LLNWHTTPResponse *response))success failure:(void(^)(LLNWHTTPResponse *response))failure;

@end
